<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul>
    <li class="item">第1个</li>
    <li class="item">第2个</li>
    <li class="item">第3个</li>
    <li class="item">第4个</li>
    <li class="item">第5个</li>
  </ul>
  <script>

    let arr = [21, 34, 54, 6]
    arr = new Array(12, 4, 54, 56)
    console.log(arr);

    arr = Array.of(12, 34, "45", 5, true)
    console.log(arr);
    arr = Array.of();
    console.log(arr);

    arr = Array.from([16, 22, 3, 4, 5])
    console.log(arr);


    let index = arr.findIndex((v, i, arr) => {
      if (v < 5) {
        return i;
      }
    })
    console.log(index);

    arr = [12, 3, [23, 45, [23, 45, 76], 13, 45], 55, 88]
    arr = arr.flat(2);//抚平数组,多维数组 转 指定维数数组
    console.log(arr);
    let arr2 = [...arr]
    console.log(arr2);
    let arr3 = ['admin', true, 123]
    let arr4 = [...arr3, ...arr2]//合并数组
    console.log(arr4);

    let list = document.querySelectorAll('.item')
    console.log(list);
    let arr5 = [...list]//伪数组转数组
    console.log(arr5);

    function init (a, b, ...c) {
      console.log(a, b, c);
    } init(12, 45, 23, 45, 56, 67)
  </script>
</body>

</html>